<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>编辑订单表</title>
	<#include "/common/vue_resource.ftl">
</head>
<body>
<div id="app" v-cloak>
	<div class="ui-form">
		<form class="layui-form" @submit.prevent="submitForm()" method="post">
			<div class="layui-form-item">
				<label class="layui-form-label">主键<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.id" placeholder="请输入主键" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">会员id<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.memberId" placeholder="请输入会员id" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">优惠券id<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.couponId" placeholder="请输入优惠券id" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">订单编号<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.orderSn" placeholder="请输入订单编号" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">用户帐号<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.memberUsername" placeholder="请输入用户帐号" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">订单总金额<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.totalAmount" placeholder="请输入订单总金额" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">应付金额（实际支付金额）<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.payAmount" placeholder="请输入应付金额（实际支付金额）" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">运费金额<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.freightAmount" placeholder="请输入运费金额" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">促销优化金额（促销价、满减、阶梯价）<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.promotionAmount" placeholder="请输入促销优化金额（促销价、满减、阶梯价）" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">积分抵扣金额<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.integrationAmount" placeholder="请输入积分抵扣金额" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">优惠券抵扣金额<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.couponAmount" placeholder="请输入优惠券抵扣金额" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">管理员后台调整订单使用的折扣金额<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.discountAmount" placeholder="请输入管理员后台调整订单使用的折扣金额" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">支付方式：0->未支付；1->支付宝；2->微信<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.payType" placeholder="请输入支付方式：0->未支付；1->支付宝；2->微信" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">订单来源：0->PC订单；1->app订单<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.sourceType" placeholder="请输入订单来源：0->PC订单；1->app订单" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">订单状态：0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.status" placeholder="请输入订单状态：0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">订单类型：0->正常订单；1->秒杀订单<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.orderType" placeholder="请输入订单类型：0->正常订单；1->秒杀订单" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">物流公司(配送方式)<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.deliveryCompany" placeholder="请输入物流公司(配送方式)" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">物流单号<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.deliverySn" placeholder="请输入物流单号" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">自动确认时间（天）<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.autoConfirmDay" placeholder="请输入自动确认时间（天）" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">可以获得的积分<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.integration" placeholder="请输入可以获得的积分" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">可以活动的成长值<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.growth" placeholder="请输入可以活动的成长值" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">发票类型：0->不开发票；1->电子发票；2->纸质发票<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.billType" placeholder="请输入发票类型：0->不开发票；1->电子发票；2->纸质发票" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">活动信息<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.promotionInfo" placeholder="请输入活动信息" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">发票抬头<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.billHeader" placeholder="请输入发票抬头" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">发票内容<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.billContent" placeholder="请输入发票内容" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">收票人电话<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.billReceiverPhone" placeholder="请输入收票人电话" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">收票人邮箱<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.billReceiverEmail" placeholder="请输入收票人邮箱" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">收货人姓名<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.receiverName" placeholder="请输入收货人姓名" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">收货人电话<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.receiverPhone" placeholder="请输入收货人电话" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">收货人邮编<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.receiverPostCode" placeholder="请输入收货人邮编" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">城市<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.receiverCity" placeholder="请输入城市" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">区<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.receiverRegion" placeholder="请输入区" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">详细地址<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.receiverDetailAddress" placeholder="请输入详细地址" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">备注<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.note" placeholder="请输入备注" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">确认收货状态：0->未确认；1->已确认<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.confirmStatus" placeholder="请输入确认收货状态：0->未确认；1->已确认" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">下单时使用的积分<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.useIntegration" placeholder="请输入下单时使用的积分" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">支付时间<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.paymentTime" placeholder="请输入支付时间" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">发货时间<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.deliveryTime" placeholder="请输入发货时间" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">确认收货时间<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.receiveTime" placeholder="请输入确认收货时间" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">评价时间<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.commentTime" placeholder="请输入评价时间" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">是否删除(1是，2否)<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.isDel" placeholder="请输入是否删除(1是，2否)" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">创建人id<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.createId" placeholder="请输入创建人id" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">创建时间<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.createTime" placeholder="请输入创建时间" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">修改人id<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.modifyId" placeholder="请输入修改人id" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">修改时间<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.modifyTime" placeholder="请输入修改时间" class="layui-input"/>
				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="submit" value="保存" class="layui-btn" />
				</div>
			</div>
		</form>
	</div>
</div>
<script>
	var app = new Vue({
		el: '#app',
		data: {
			showTypes: false,
			record : {
				id:'${params.id!}',
				id:'',
				memberId:'',
				couponId:'',
				orderSn:'',
				memberUsername:'',
				totalAmount:'',
				payAmount:'',
				freightAmount:'',
				promotionAmount:'',
				integrationAmount:'',
				couponAmount:'',
				discountAmount:'',
				payType:'',
				sourceType:'',
				status:'',
				orderType:'',
				deliveryCompany:'',
				deliverySn:'',
				autoConfirmDay:'',
				integration:'',
				growth:'',
				billType:'',
				promotionInfo:'',
				billHeader:'',
				billContent:'',
				billReceiverPhone:'',
				billReceiverEmail:'',
				receiverName:'',
				receiverPhone:'',
				receiverPostCode:'',
				receiverCity:'',
				receiverRegion:'',
				receiverDetailAddress:'',
				note:'',
				confirmStatus:'',
				useIntegration:'',
				paymentTime:'',
				deliveryTime:'',
				receiveTime:'',
				commentTime:'',
				isDel:'',
				createId:'',
				createTime:'',
				modifyId:'',
				modifyTime:'',
			},
		},
		mounted: function () {
			this.init();
			this.loadData();
		},
		methods: {
			init:function(){
				var that = this;
				/*laydate.render({elem: '#beginDate', type:'datetime', done:function (value) {
						that.record.beginDate = value;
					}});*/

			},
			loadData: function () {
				if (!'${params.id!}') {
					return;
				}
				var that = this;
				$.http.post('${params.contextPath}/web/omsOrder/query.json', {id: '${params.id!}'}).then(function (data) {
					if (!data.success) {
						$.message(data.message);
						return;
					}
					var item = data.data;
					for (var key in  that.record) {
						that.record[key] = item[key];
					}
				});
			},
			submitForm: function () {
				$.http.post('${params.contextPath}/web/omsOrder/<#if (params.id)??>modify<#else>save</#if>.json', this.record).then(function (data) {
					if (!data.success) {
						$.message(data.message);
						return;
					}
					var alt = layer.alert(data.message || "操作成功", function () {
						parent.app.loadData();
						parent.layer.closeAll();
						layer.close(alt);
					});
				});
			},
		}
	});
</script>
</body>

</html>
